package com.pc.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pc.enrty.Food;
import com.pc.enrty.User;
import com.pc.service.FoodService;
import com.pc.service.ShoppingTrolleyService;
import com.pc.util.ResultObject;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.List;

import java.util.ArrayList;

@RestController
@RequestMapping("/food/")
public class FoodController {
    @Autowired
    private FoodService foodService;
    @Autowired
    private ResultObject result;
    @Autowired
    private ShoppingTrolleyService shoppingTrolleyService;

    /**
     * 商品列表
     *
     * @return
     */
    @RequestMapping("show")
    public ResultObject showpage(Food food, int pageNum,int pageSize) {
        result.setStatus(400);
        PageInfo<Food> pageinfo=foodService.findByIdCidAndName(food,pageNum,pageSize);
        result.setResult(pageinfo);
        return result;
    }

    @RequestMapping("find")
    public ResultObject findEvery(Food food) {
        return result;
    }
}
